<!DOCTYPE html>
<html>
	<head>
		<title>预约时间修改</title>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
		<link rel="stylesheet" href="${s.base}/mobile/newcss/weui.min.css">
		<link rel="stylesheet" href="${s.base}/mobile/newcss/jquery-weui.css">
		<link rel="stylesheet" href="${s.base}/mobile/newcss/base.css?123456">
		<link rel="stylesheet" type="text/css" href="${s.base}/mobile/css/city.css"/>
		<link rel="stylesheet" type="text/css" href="${s.base}/mobile/js/DateSelector/DateSelector.css?rev=@@hash"/>
	</head>


	<style type="text/css">
		html,body{background:#f5f5f5;}
		.xyg-comp-list-select{width:96%; margin: 0.2rem 2%; border-radius: 0.5rem; height:auto;}
		.xyg-comp-list-select-desc{width:100%;text-align:center;line-height:2.2rem; height:2.2rem;font-size: 0.8rem; color:#ffffff; letter-spacing: 0.01rem; border-radius: 0.2rem 0.2rem 0px 0px; background: #069AFE;border-right: 0.001rem solid #f5f5f5;border-left: 0.001rem solid #f5f5f5;}
		.xyg-comp-list-select-item{width:90%; padding:0px 5%; line-height:2rem; height:2rem;font-size: 0.8rem; color:#333333; letter-spacing: 0.01rem; background: #FFF; border: 0.001rem solid #f5f5f5;}
		.xyg-comp-list-select-item input::-webkit-input-placeholder {color: #999999;}
		.xyg-comp-list-select-item .xyg-comp-list-select-item-title{width:30%; font-size: 14px; color:#333333; height:1.8rem; text-align:left; float:left;}
		.xyg-comp-list-select-item .xyg-comp-list-select-item-content{width:70%; height:1.8rem; text-align:right; float:left;}
		.xyg-comp-list-select-item .xyg-comp-list-select-item-content input[type='text']{width:100%; font-size: 14px; height:1.8rem; line-height:1.8rem;background-color:transparent;border:0; text-align:right;}

		.xyg-comp-list-select-textarea{width:90%;  color:#333333;padding:0px 5%;height:13.2rem;font-size: 0.8rem;  letter-spacing: 0.01rem; background: #FFF; border: 0.001rem solid #f5f5f5;}
		.xyg-comp-list-select-textarea .xyg-comp-list-select-textarea-title{width:100%; line-height: 2rem; height:2rem; text-align:left;}
		.xyg-comp-list-select-textarea .xyg-comp-list-select-textarea-content{width:100%; height:4rem; text-align:left; float:left;}
		.xyg-comp-list-select-textarea .xyg-comp-list-select-textarea-content textarea{width:92%; padding: 0.2rem 4%; height:9.6rem; margin-bottom: 1rem; line-height:1rem;background-color:#E5E5E5;;border:0; text-align:left;}

		.xyg-comp-xy{height:2rem; line-height:2rem;width:93%; margin:0px 2% 0px 5%;}
		.xyg-bottom{width:90%; height:auto;  margin:1.5rem 5%;}
		.xyg-bottom  .xyg-btn{
			position: relative;
			background: #069AFE;
			display: block;
			margin-left: auto;
			margin-right: auto;
			padding-left: 14px;
			padding-right: 14px;
			box-sizing: border-box;
			font-size: 18px;
			text-align: center;
			text-decoration: none;
			color: #fff;
			line-height: 2.55555556;
			border-radius: 5px;
			-webkit-tap-highlight-color: rgba(0,0,0,0);
			overflow: hidden;
		}
	</style>
	<body>
	<div id="showContent">
		<div class="xyg-comp-list-select">
			<input type="hidden" value="${webSub.id}" id="id" />
			<div class="xyg-comp-list-select-item">
				<div class="xyg-comp-list-select-item-title">
					<span style="color:#ff3b30;">&nbsp;</span>服务
				</div>
				<div class="xyg-comp-list-select-item-content">
					<input type="text"  value="${webSub.colId}" readonly/>
				</div>
			</div>
			<div class="xyg-comp-list-select-item">
				<div class="xyg-comp-list-select-item-title">
					<span style="color:#ff3b30;">&nbsp;</span>姓名
				</div>
				<div class="xyg-comp-list-select-item-content">
					<input type="text" value="${webSub.name}" readonly/>
				</div>
			</div>

			<div class="xyg-comp-list-select-item">
				<div class="xyg-comp-list-select-item-title">
					<span style="color:#ff3b30;">&nbsp;</span>联系电话
				</div>
				<div class="xyg-comp-list-select-item-content">
					<input type="text" value="${webSub.phone}" readonly />
				</div>
			</div>
			<div class="xyg-comp-list-select-item">
				<div class="xyg-comp-list-select-item-title">
					<span style="color:#ff3b30;">*</span>日期
				</div>
				<div class="xyg-comp-list-select-item-content">
					<input type="text" id="buyDate" value="${webSub.buyDate}" placeholder="请选输入日期" />
				</div>
			</div>
			<div class="xyg-comp-list-select-item">
				<div class="xyg-comp-list-select-item-title">
					<span style="color:#ff3b30;">*</span>时间
				</div>
				<div class="xyg-comp-list-select-item-content">
					<input type="text" id="buyTime" value="${webSub.buyTime}" placeholder="请选输入时间" />
				</div>
			</div>
		</div>
		<div class="xyg-bottom">
			<a href="javascript:void(0);" class="xyg-btn" id="showTooltips" >提交</a>
		</div>
	</div>
	<div id="targetContainers"></div>
	</body>
	<script src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
	<script src="${s.base}/mobile/newjs/jquery-2.1.4.js?12132"></script>
	<script src="${s.base}/mobile/newjs/jquery-weui.js?12132"></script>
	<script src="${s.base}/mobile/fonts/iconfont.js?121322323"></script>
	<script src="${s.base}/mobile/js/base.js?12345454547777"></script>
	<!--js分享代码开始-->

	<input type="hidden" value="${jSTicketShareResponse.appid}" id="appid" />
	<input type="hidden" value="${jSTicketShareResponse.fxTitle}" id="fxTitle" />
	<input type="hidden" value="${jSTicketShareResponse.fxImgUrl}" id="fxImgUrl" />
	<input type="hidden" value="${jSTicketShareResponse.fxDesc}" id="fxDesc" />
	<input type="hidden" value="${jSTicketShareResponse.fxUrl}" id="fxUrl" />
	<input type="hidden" value="${jSTicketShareResponse.nonceStr}" id="nonceStr" />
	<input type="hidden" value="${jSTicketShareResponse.timestamp}" id="timestamp" />
	<input type="hidden" value="${jSTicketShareResponse.signature}" id="signature" />
	<script src="${s.base}/mobile/js/share.js"></script>

	<script src="${s.base}/mobile/js/DateSelector/DateSelector.js"></script>
	<script type="text/javascript">
		var memberId = '${memberId}';
        new DateSelector({
            input: 'buyTime',//点击触发插件的input框的id
            container: 'targetContainers',//插件插入的容器id
            type: 0,
            param: [0, 0, 0, 1, 1],
            beginTime: [10, 0],
            endTime: [17, 59],
            recentTime: [8, 0],
            success: function (arr, arr2) {
                $("#buyTime").val(arr2[0]+"时"+arr2[1]+"分")
            }//回调
        });

        var num=1;
        $("#buyDate").calendar({
            value:['${startDate}'],
            minDate: ['${minDate}'],
            dateFormat: 'yyyy-mm-dd',  // 自定义格式的时候，不能通过 input 的value属性赋值 '2016年12月12日' 来定义初始值，这样会导致无法解析初始值而报错。只能通过js中设置 value 的形式来赋值，并且需要按标准形式赋值（yyyy-mm-dd 或者时间戳)
            onChange: function (p, values, displayValues) {
                var day = new Date(Date.parse(values[0].replace(/-/g, "/")));
               	num=day.getDay();
            },
            onClose: function (p) {
                if(num==0||num==6){
                    $.toast("周六和周日不上班","text");
                    $("#buyDate").val("");
                    return false;
                }
            }
        });

        $("#showTooltips").on("click", function () {
            var id = $("#id").val();

            var buyDate = $("#buyDate").val();
            if (buyDate == null || buyDate == "") {
                $.toast("请输入日期", "text");
                return false;
            }
            var buyTime = $("#buyTime").val();
            if (buyTime == null || buyTime == "") {
                $.toast("请输入时间", "text");
                return false;
            }

            var param = {
                id: id,
                buyDate: buyDate,
                buyTime: buyTime
            };
            $.showLoading("正在提交中");
            $.post("/phone/webSubUpdate", param, function (result) {
                if(1==result.returnInfo.state){
                    $.hideLoading();
                    $.alert("修改提交成功，等待审核！", function() {
                        //点击确认后的回调函数
                        myHome(memberId);
                    });

                }else{
                    $.hideLoading();
                    $.toast("修改失败", "text");
                }

            }, "json");


        });
	</script>
</html>
